home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / win_m_p / nied14.zip / INIEDIT.TXT < prev   
Text File  |  1991-10-17  |  23KB  |  578 lines

  1.  
  2.                              INIEDIT - Version 1.03
  3.  
  4.                Copyright (C) 1991 Richard R. Sands CIS 70274,103
  5.                               All rights reserved
  6.  
  7.  
  8.                   Documentation last updated October 17, 1991
  9.  
  10.  
  11. OVERVIEW
  12. --------
  13.  
  14.    If you often find yourself editing your WIN.INI, SYSTEM.INI, or any
  15.    other INI file before you start Windows, then this program is for you!
  16.  
  17.    INIEDIT provides batch file editing of your INI files so you can start up
  18.    Windows with mnemonic commands.  This program reads a text file of editing
  19.    commands that instruct it to modify the various .INI files by section and
  20.    keywords.  You can change the contents of a line, delete lines, comment,
  21.    and uncomment them.  You may include several labeled sections in your
  22.    INIEDIT script so you can have all of your various Windows configurations
  23.    in one text file.
  24.  
  25.    Why did I write this program?  I have a portable that, at work, is
  26.    connected to a network, at home it's not.  When on the network, I have
  27.    several utilities I need to load, and although at home, they detect the
  28.    lack of the network, I end up having to click a bunch of OK buttons.  I
  29.    have customized system fonts that I like to use, but as a programmer, I
  30.    like to boot windows with the "standard" font to check the dialog box
  31.    metrics.  Sometimes, I want to just start windows without having to load
  32.    up all my favorite utilities - get in quick - get out quick.  I use
  33.    different "shell" programs depending on what "type" of environment I want
  34.    to be in.  You get the picture.  With INIEDIT all of these actions are
  35.    easily (read I-Don't-Have-To-Remember-Anything) written into a menu or
  36.    batch file.
  37.  
  38.    This program is best used in a batch file, or with your favorite Menuing
  39.    Program.
  40.  
  41.  
  42. SYSTEM REQUIREMENTS
  43. -------------------
  44.  
  45.    Microsoft Windows 3.0
  46.  
  47.    INIEDIT has been tested with all DOS Versions 2.11 through 5.0.  It's 
  48.    memory requirements depend on the size of your largest INI file (but 
  49.    limited to 4000 lines of text).
  50.  
  51.  
  52. STARTING INIEDIT
  53. ----------------
  54.  
  55.    IniEdit requires at least 1 parameter: The Script Filename.  This is a
  56.    normal ascii file that contains the commands you want to be executed.
  57.  
  58.    In addition you may place some Switch Options that modify the way
  59.    INIEDIT behaves.
  60.  
  61.    The formal syntax for starting INIEDIT is as follows:
  62.  
  63.             INIEDIT     <-- This will display version & help screen
  64.          or
  65.             INIEDIT filename.ext [labels] [options]
  66.  
  67.    where
  68.  
  69.          filename.ext   is the name of the text file that contains your
  70.                         editing commands.
  71.  
  72.          [labels]       are optional. A label designates one or more
  73.                         sections of your INIEDIT script to be executed.
  74.                         You may have more than 1 label on the command
  75.                         line.
  76.  
  77.          [options]      are optional, and must be preceded with a "/"
  78.                         character.  The options are:
  79.  
  80.                           /?     Displays version and help screen.
  81.  
  82.                           /B-    Disable backup files.  Normally, INIEDIT
  83.                                  will always backup your file up before
  84.                                  making any edits.
  85.  
  86.                           /D+    Enable "Debug" mode.  This will display each
  87.                                  line as it is executed with additional info
  88.                                  so you can track down any errors in your
  89.                                  (or my) logic.
  90.  
  91.                           /L+    Show a list of all labels found in the
  92.                                  INIEDIT script file.  This is useful if your
  93.                                  file requires a user-label entered on the
  94.                                  command line.  Your batch file can check
  95.                                  for a parameter, and if not found then issue
  96.                                  this switch.  This switch returns a DOS
  97.                                  Errorlevel of 1.
  98.  
  99.                           /P-    Don't pause for a key when an error occurs.
  100.                                  This is on by default.  You can check for
  101.                                  errors in your batch file with the DOS
  102.                                  errorlevel variable.
  103.  
  104.                           /W+    Show warnings and wait for a key to proceed.
  105.                                  This is off by default.  Warnings are
  106.                                  ususally available only in Debug Mode.
  107.  
  108.  
  109. EDITING COMMANDS
  110. ----------------
  111.  
  112.    All commands to INIEDIT are entered into a regular ascii text file created
  113.    with your favorite TEXT editor (or WP w/Text Out).
  114.  
  115.    There are six basic commands:
  116.  
  117.       APPEND      Adds a keyword to the section regardless if it exists
  118.       COMMENT     This will make a keyword entry into a comment.
  119.       DELETE      This can delete a whole section or just one keyword.
  120.       EDIT        This will change the contents of a keyword entry.
  121.       EXIT        Quit processing the script file
  122.       INI         Opens an .INI file for editing
  123.       UNCOMMENT   This changes a commented line into a regular line.
  124.  
  125.  
  126.    Each command is written on it's own line.  Lines may not wrap, but may be
  127.    up to 255 characters (including leading blanks) long.  For each command,
  128.    you may write the whole command (eg. COMMENT) or just the first three
  129.    letters (eg. COM).
  130.  
  131.    For all commands except EXIT and INI, the syntax is identical.  You
  132.    include the command, the DOS Ini filename (path & .ext not required), the
  133.    section name enclosed in square brackets, and, the keyword/value pair
  134.    separated with an equal sign ("=").
  135.  
  136.    For example:
  137.  
  138.                  EDIT WIN [Windows] Beep=No
  139.  
  140.    This command will change the BEEP keyword under the [Windows] section of
  141.    the WIN.INI file to NO.
  142.  
  143.    Comments are lines starting with a semi-colon.  The line does not have
  144.    to start in column one.  Comments must be on their own line.  This is a
  145.    remark in the INIEDIT script file:
  146.  
  147.                  ; This is a valid remark
  148.  
  149.    Labels are used to "tag" sections of the INIEDIT script to be used with
  150.    a parameter sent from the command line.  This way you can have several
  151.    different configurations without having to have them in separate files (as
  152.    in INIEDIT Version 1.01).  Given a INIEDIT script with these two
  153.    sections:
  154.  
  155.              ; This is TEST.MOD  (the .MOD means MODifications)
  156.              :FAST
  157.                 EDIT Win Load=
  158.                 EDIT Win Run=
  159.                 EXIT
  160.              :SLOW
  161.                 EDIT Win Load=C:\AFTERDRK\AD NWSEND EMAIL RESGUAGE BIGDESK
  162.                 EDIT Win Run=SkeyWin YaClock
  163.                 EXIT
  164.  
  165.    Then having your batch file (or Menu) give this command:
  166.  
  167.               INIEDIT Test.Mod SLOW
  168.  
  169.    Will execute the section listed under ":SLOW" and this command:
  170.  
  171.               INIEDIT test.mod fast
  172.  
  173.    would execute the section listed under ":FAST".  Note the EXIT commands
  174.    at the end of each section.  If you don't have one, it will "fall"
  175.    through to the next section (which could be construed as a feature!).
  176.  
  177.    You can place more than one label on the command line.  This has the
  178.    effect of executing each section.  This command will execute two
  179.    sections:
  180.  
  181.               INIEDIT test.mod slow fast
  182.  
  183.    You may also have descriptions attached to your labels.  This is very
  184.    useful when the Show Labels switch is used (/L+):
  185.  
  186.              :FAST - Don't load any utilities
  187.              :SLOW - Load all utilities
  188.  
  189.    There are no flow-control statements.  The sequence of execution is
  190.    essentially linear.  I was tempted to put in a CALL/GOTO command but I
  191.    found it -really- wasn't needed.  So far, no one has complained.  If you
  192.    can give me a good situation where you would want one, I'll consider it
  193.    for the next release.
  194.  
  195.  
  196. A MOMENT OF REFLECTION
  197. ----------------------
  198.    As I wrote this program, I considered adding commands for creating and
  199.    executing some kind of menu system.  After some reflection, I decided
  200.    that the last thing the world needs is a new menu system.  If you really
  201.    need one, I can provide a simple DOS Batch File based system with color,
  202.    nested menus, etc. with all commands using regular batch file commands
  203.    and one small utility.  Again, if you think there is an overriding
  204.    reason for including these type of commands let me know and I'll consider
  205.    it for the next release.
  206.  
  207.  
  208. COMMAND ABBREVIATIONS
  209. ---------------------
  210.    INIEDIT Version 1.01 allowed the first three characters of the command to
  211.    be used rather than the whole command (eg. COM for COMMENT).  This is
  212.    still enabled, but in lieu of future versions, you are encouraged to use
  213.    the whole command.
  214.  
  215.  
  216. SAMPLE BATCH FILES
  217. ------------------
  218.  
  219.    This batch file will start Windows after modifying the various INI files
  220.    that I need.  It first checks for no parameters, and if none, displays
  221.    all the labels in the file.  Otherwise it executes the INIEDIT program
  222.    and checks for any errors.  If no errors then windows is started.
  223.  
  224.       @Echo Off
  225.         C:
  226.         cd C:\WIN
  227.         if %1!==! GOTO Error              (check for required parameter)
  228.         INIEDIT WinBoot.Mod %1 %2 %3      (allow user to specify labels)
  229.         if ERRORLEVEL 1 GOTO Done         (check for any errors)
  230.         Win                               (start Windows)
  231.         GOTO Done                         (and quit)
  232.       :Error
  233.         INIEDIT WinBoot.Mod /L+           (display list of labels)
  234.       :Done
  235.  
  236.  
  237. THE FUTURE OF INIEDIT
  238. ---------------------
  239.    I don't think INI files are going to go away, so this program should be
  240.    useful for the next few versions of Windows.
  241.  
  242.    Some suggestions that I have not implemented (yet) are some control
  243.    commands (eg. GOTO or CALL), some substring handling for modifing portions
  244.    of a keyword (eg. remove "clock" from LOAD=Calc Clock Bye),  some screen
  245.    handling commands for creating prompts/menus,
  246.  
  247.    I've even had a request for an OS/2 version.
  248.  
  249.    Depending on additional interest, these types of commands, or other
  250.    commands could very well appear on future releases of INIEDIT.
  251.  
  252.  
  253. COMMAND REFERENCE
  254. -----------------
  255.  
  256.    Manual Conventions
  257.  
  258.       Because the use of the [] symbols to denote sections, I will write
  259.       required values in uppercase.
  260.  
  261.                 EDIT win [section] KEYWORD=value
  262.  
  263.  
  264.       All keywords must have an equal sign after them even if nothing
  265.       follows.
  266.  
  267.                 EDIT Win [Windows] Run=
  268.  
  269.  
  270.    --------------------------------------------------------------------------
  271.                                                                        APPEND
  272.    APPEND ini [section] KEYWORD=value
  273.  
  274.    Appends (or adds) the contents of the keyword under the [section] heading.
  275.    If no [section] is provided, then it appends the keyword to the first
  276.    section that keyword appears under.  Otherwise, it appends the keyword
  277.    after the last keyword matching in the section.
  278.  
  279.    This is provided mostly to handle adding new DEVICE entries in the
  280.    SYSTEM.INI file.  To edit these kind of entries, you need to first try to
  281.    delete the keyword, then append it:
  282.  
  283.           INI System
  284.           DELETE [386Enh] DEVICE = vnetware.drv
  285.           APPEND [386Enh] DEVICE = v3com.drv
  286.  
  287.    APPEND will not add duplicate lines.  I cannot think of any reason why
  288.    any "keyword=value" would be duplicated exactly.
  289.  
  290.    While in debug mode (/D+) you may see "warnings" like "keyword not found".
  291.    These are "soft" errors, INIEDIT will add the keyword AND section if it
  292.    does not exist.
  293.  
  294.    Examples:
  295.  
  296.             APPEND system [386Enh] device=special.drv
  297.  
  298.  
  299.    --------------------------------------------------------------------------
  300.                                                                       COMMENT
  301.    COMMENT ini [section] KEYWORD=value
  302.  
  303.    Changes the section/line containing the keyword to be a comment.  This is
  304.    a non-destructive way of "deleting" keyword entries.  If the VALUE entry
  305.    is present, then an exact match made.  This is useful when using COMMENT
  306.    with the "device" keywords in the SYSTEM.INI file since there are multiple
  307.    occurences of this keyword.
  308.  
  309.    If no [section] is provided, then it changes the value of the first
  310.    keyword under -any- section that matches.  See the EDIT entry.
  311.  
  312.    Keywords not found are "soft" errors and ignored by INIEDIT.
  313.  
  314.    Examples:
  315.         COMMENT System [boot.description] network.drv=
  316.         COMMENT System [386Enh] network=*vnetbios, vnetware.386, vipx.386
  317.         COMMENT Win [Clock]
  318.  
  319.  
  320.    --------------------------------------------------------------------------
  321.                                                                        DELETE
  322.    DELETE ini [SECTION] KEYWORD=value
  323.  
  324.    Deletes a keyword from the active ini file.  If the keyword is not given,
  325.    then it deletes the whole section from the ini file.  Note that you must
  326.    supply [section] AND/OR keyword.  If you supply a value entry, then an
  327.    exact match is performed.  This is useful for the SYSTEM.INI's device=
  328.    values which can appear more than once in each section.
  329.  
  330.    NOTE: This is a hold-over from INIEDIT Version 1.01.  It is best that you
  331.          use COMMENT/UNCOMMENT rather than DELETE.  However, I will continue
  332.          to keep this command. 
  333.  
  334.    If no [section] is provided, then it changes the value of the first
  335.    keyword under -any- section that matches.  See the EDIT entry.
  336.  
  337.    Examples:
  338.              DELETE Win [Clock]
  339.              DELETE Win [Clock] iFormat=
  340.              DELETE Win [Clock] iFormat=1
  341.              DELETE Win iFormat=1
  342.  
  343.  
  344.    --------------------------------------------------------------------------
  345.                                                                          EDIT
  346.    EDIT ini [section] KEYWORD=value
  347.  
  348.    Changes (or adds) the contents of the keyword under the [section] heading.
  349.    If no [section] is provided, then it changes the value of the first
  350.    keyword under -any- section that matches.  You might be safe saying:
  351.  
  352.          EDIT Win Load=Clock
  353.  
  354.    But you might have problems with a command like:
  355.  
  356.          EDIT Win iFormat=0
  357.  
  358.    Because several programs use the iFormat keyword, and you could be -sure-
  359.    that the iFormat you meant was changed.  It would be better to write a
  360.    statement like:
  361.  
  362.          EDIT win [Clock] iFormat=0
  363.  
  364.    While in debug mode (/D+) you may see "warnings" like "keyword not found".
  365.    These are "soft" errors, INIEDIT will add the keyword AND section if it
  366.    does not exist.
  367.  
  368.    NOTE: If you are trying to change the value of a keyword that appears more
  369.          than once in a section (eg. SYSTEM.INI's DEVICE keywords) then this
  370.          command will only edit the first item.  You should use COMMENT and
  371.          UNCOMMENT to change those types of entries.
  372.  
  373.    Examples:
  374.  
  375.             EDIT system [boot] shell=msdos.exe
  376.             EDIT win [desktop] WallPaper=G:\BITMAPS\MMONROE.BMP
  377.  
  378.  
  379.    --------------------------------------------------------------------------
  380.                                                                          EXIT
  381.    EXIT
  382.  
  383.    Terminates the execution of the script.
  384.  
  385.    This is typically used when you want only a certain portion of a script to
  386.    be executed.  Script sections always have a label to designate the section
  387.    (except, possibly, for the first section).
  388.  
  389.    EXIT is not required if the section is the last section in the file.
  390.  
  391.    Example:
  392.             :Label1
  393.                edit win [clock] iformat = 1
  394.                EXIT
  395.             :Label2
  396.                edit win [clock] iformat = 0
  397.  
  398.  
  399.    --------------------------------------------------------------------------
  400.                                                                           INI
  401.    INI
  402.  
  403.    Opens an .INI file for editing.
  404.  
  405.    This is typically used at the start of a section.  It is an optional
  406.    command since you can include the INI file on the line of each command.
  407.  
  408.    Example:
  409.             :Label1
  410.                INI Win
  411.                edit [clock] iformat = 1
  412.                edit [desktop] WallPaper = Cube.Bmp
  413.                EXIT
  414.  
  415.  
  416.    --------------------------------------------------------------------------
  417.                                                                     UNCOMMENT
  418.    UNCOMMENT ini [section] KEYWORD=value
  419.  
  420.    Changes the commented line or section containing the section/keyword to be
  421.    an active statement.  This is the compliment of the COMMENT command. If the
  422.    VALUE entry is present, then an exact match made.  This is useful when
  423.    using COMMENT with the "device" keywords in the SYSTEM.INI file since
  424.    there are multiple occurences of this keyword.
  425.  
  426.    If no [section] is provided, then it changes the value of the first
  427.    keyword under -any- section that matches.  See the EDIT entry.
  428.  
  429.    Keywords not found are "soft" errors and ignored by INIEDIT.
  430.  
  431.    Examples:
  432.         UNCOMMENT System [boot.description] network.drv=
  433.         UNCOMMENT System [386Enh] network=*vnetbios, vnetware.386, vipx.386
  434.         UNCOMMENT Win [Clock]
  435.  
  436.  
  437. ERROR MESSAGES
  438. --------------
  439.  
  440.    There are two levels of errors: Soft and Hard.  Soft errors are warnings.
  441.    Soft errors are (ususally) ignored during normal execution of the program,
  442.    they are only reported during Debug Mode (/D+) or if you have the Show
  443.    Warnings switch (/W+) active.  They do not stop the program.  Hard errors
  444.    will stop the program and won't make any changes to the current INI file.
  445.    If a Hard Error occurs, then the program will wait for a key to be pressed
  446.    unless the user has specified No Pause On Error (/P-).
  447.  
  448.  
  449.    Entry Already Exists: [section] keyword=value
  450.         This is reported by the APPEND command.  This merely means that the
  451.         target line already is present.
  452.  
  453.    Exact Match to "[Section] Keyword=Value" not found
  454.         This is reported as a warning by COMMENT/UNCOMMENT if an exact match
  455.         is specified but not found.
  456.  
  457.    File not found: d:\path\filename.INI
  458.         Attempt to open an .INI file that does not exist.  Check the path of
  459.         the filename and spelling.
  460.  
  461.    File not open: d:\path\filename.INI
  462.         An attempt was made to write an INI file that was not opened.  Check
  463.         the path of the filename and spelling.
  464.  
  465.    Label "xxxx" not found
  466.         A label parameter supplied on the command line was not included in
  467.         the INIEDIT script file.
  468.  
  469.    No INI file opened!
  470.         A command is about to be executed (any command but EXIT) and there
  471.         is no INI file opened.  Include the INI filename, at least, on the
  472.         first statement of each section.
  473.  
  474.    Parameter file not found: d:\path\filename.ext
  475.         This means you gave an incorrect filename to be used as the INIEDIT
  476.         script.  INIEDIT makes no assumptions about the file extension you
  477.         used.  Also, check the path of the filename.
  478.  
  479.    Too many lines in d:\path\filename.INI
  480.         The INI file you have tried to edit has grown too large.  INIEDIT
  481.         can only edit files up to 4000 lines long.  (If you have a INI file
  482.         that gets this error, I'd like to see it!)
  483.  
  484.    Too many user parameters
  485.         You are allowed 15 "User Parameters" to the INIEDIT program.  I think
  486.         this should be sufficient for 99% of all uses<g>.
  487.  
  488.    Unknown identifier: xxx
  489.         An unknown command has been encountered in the INIEDIT script file.
  490.         Check your spelling.
  491.  
  492.    Unknown Switch: /x
  493.         You have included a switch that INIEDIT does not understand on the
  494.         command line.  Check your batch file / Menu.
  495.  
  496.    You must include a filename
  497.         You must include a filename on the command line to INIEDIT.  INIEDIT
  498.         does not make any assumptions about what file extension you have
  499.         used.
  500.  
  501.    Runtime Errors 200-203
  502.         These are Turbo Pascal errors and generally mean you have run out of
  503.         memory for the program's data.  This should not happen if you are
  504.         going into Windows.  If it does, it would me that you really don't
  505.         have enough memory to go into Windows.  Check and make sure that you
  506.         are not "shelled" out of another program.
  507.  
  508.  
  509. INIEDIT HISTORY
  510. ---------------
  511.  
  512.     Version 1.01 March 1991
  513.        Released for use at MCGNW, Inc.
  514.  
  515.     Version 1.02  Sept. 4, 1991
  516.        Added some features:
  517.           * Multiple files combined into one via labels
  518.           * EXIT command
  519.           * Long command names for clarity
  520.        Released as shareware on CompuServe 09/09/91
  521.  
  522.     Version 1.03  Sept. 17, 1991 - User Found
  523.        Bug Fix: DELETE, COMMENT, and UNCOMMENT performed their action only
  524.                 on the first keyword in the section.  This error occured only
  525.                 when a section had multiple entries with the same keyword.
  526.  
  527.     Version 1.04  Nov. 17, 1991 - User Suggested
  528.        Added: APPEND command
  529.  
  530.  
  531. LEGAL & REGISTRATION STUFF
  532. --------------------------
  533.  
  534.     This program is supplied "As Is".  I make no claims about the suitability
  535.     of this software on your computer system.  I have made my best effort to
  536.     to keep bugs to a minimum.  I cannot be held liable for any claims I've
  537.     made that are not supported (bugs) nor for any misuse of this program,
  538.     nor for any damage that may result of using this program.
  539.  
  540.     You may freely distribute the INIEDIT.EXE and INIEDIT.TXT files as long
  541.     as INIEDIT.EXE is unregistered (any version number ending with an "s").
  542.     You may not modify the INIEDIT.EXE or INIEDIT.TXT files in any way.
  543.  
  544.     This is User-Supported software.  A lot of work went into writing this
  545.     package.  If you find this program useful, please send us $20.00 per copy
  546.     or $100 per 10 copies (other deals can be made!).  Please send checks only,
  547.     I cannot accept Credit Card orders.  In return, you will get the latest
  548.     copy of the program (with no reminder notices), laser printed documen-
  549.     tation, a '286 version, and notification of new updates.  You WILL get
  550.     notified - I keep a database of all registered users.
  551.  
  552.     CORPORATE USERS - IF YOU CONTINUE TO USE INIEDIT, YOU MUST HAVE A FULLY
  553.     REGISTERED VERSION - AN UNLIMITED-USER SITE LICENSE IS AVAILABLE.
  554.  
  555.     Whether you are registered or not, I am wide open to any enhancements you
  556.     might offer, bug reports (not MY programs!), or any comments about
  557.     anything at all.  Best way to do this is to Mail me via CIS.
  558.  
  559.  
  560.     Please send check to
  561.                          Richard Sands
  562.                          P.O. Box 3917
  563.                          Portland, Oregon  97208
  564.  
  565.     Please include the following information with your order:
  566.  
  567.          Your Name
  568.          Your Address
  569.          The Registration Name (eg. Company, Department, or Name)
  570.          Where you found the program (BBS, CIS, Shareware Publ., Friend, etc)
  571.          Your CIS number if applicable
  572.  
  573.     Thanks for your support!
  574.  
  575.     Rick Sands
  576.  
  577. <end of doc>
  578.